﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace QLCHBANGIAY.DATA
{
    public class Custommer
    {
        #region[Declare variables]
        private string _iusid;
        private string _vusername;
        private string _vpassword;
        private string _vcusname;
        private string _dbirthday;
        private string _vprovince;
        private string _vaddress;
        private string _vphone;
        private string _vmobile;
        private string _vemail;
        private string _dcreatedate;
        private string _istatus;
        #endregion
        #region[Public Properties]
        public string iusid { get { return _iusid; } set { _iusid = value; } }
        public string vusername { get { return _vusername; } set { _vusername = value; } }
        public string vpassword { get { return _vpassword; } set { _vpassword = value; } }
        public string vcusname { get { return _vcusname; } set { _vcusname = value; } }
        public string dbirthday { get { return _dbirthday; } set { _dbirthday = value; } }
        public string vprovince { get { return _vprovince; } set { _vprovince = value; } }
        public string vaddress { get { return _vaddress; } set { _vaddress = value; } }
        public string vphone { get { return _vphone; } set { _vphone = value; } }
        public string vmobile { get { return _vmobile; } set { _vmobile = value; } }
        public string vemail { get { return _vemail; } set { _vemail = value; } }
        public string dcreatedate { get { return _dcreatedate; } set { _dcreatedate = value; } }
        public string istatus { get { return _istatus; } set { _istatus = value; } }
        #endregion
        #region[tbCUSTOMERS IDataReader]
        public Custommer customerIDataReader(IDataReader dr)
        {
            Custommer obj = new Custommer();
            obj.iusid = (dr["iusid"] is DBNull) ? string.Empty : dr["iusid"].ToString();
            obj.vusername = (dr["vusername"] is DBNull) ? string.Empty : dr["vusername"].ToString();
            obj.vpassword = (dr["vpassword"] is DBNull) ? string.Empty : dr["vpassword"].ToString();
            obj.vcusname = (dr["vcusname"] is DBNull) ? string.Empty : dr["vcusname"].ToString();
            obj.dbirthday = (dr["dbirthday"] is DBNull) ? string.Empty : dr["dbirthday"].ToString();
            obj.vprovince = (dr["vprovince"] is DBNull) ? string.Empty : dr["vprovince"].ToString();
            obj.vaddress = (dr["vaddress"] is DBNull) ? string.Empty : dr["vaddress"].ToString();
            obj.vphone = (dr["vphone"] is DBNull) ? string.Empty : dr["vphone"].ToString();
            obj.vmobile = (dr["vmobile"] is DBNull) ? string.Empty : dr["vmobile"].ToString();
            obj.vemail = (dr["vemail"] is DBNull) ? string.Empty : dr["vemail"].ToString();
            obj.dcreatedate = (dr["dcreatedate"] is DBNull) ? string.Empty : dr["dcreatedate"].ToString();
            obj.istatus = (dr["istatus"] is DBNull) ? string.Empty : dr["istatus"].ToString();
            return obj;
        }
        #endregion
    }
}
